<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>DOM查找单个元素</title>
  </head>
  <body>
    <div>div标签...</div>
    <p>段落标签...</p>

    <script>
      // 打印document
      console.log(document);

      // 修改网页标题
      document.title = "被修改的标题";

      // 查找元素 - 通过JS方式获取网页的标签
      const myDiv = document.querySelector("div");
      myDiv.style.color = "red";
      console.log(myDiv);
    </script>
  </body>
</html>
